<div class="refentry" lang="en" xml:lang="en"><a id="glXSelectEvent"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glXSelectEvent — select GLX events for a window or a GLX pixel buffer</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table><tr><td><code class="funcdef">void <b class="fsfunc">glXSelectEvent</b>(</code></td><td>Display *  </td><td><var class="pdparam">dpy</var>, </td></tr><tr><td> </td><td>GLXDrawable  </td><td><var class="pdparam">draw</var>, </td></tr><tr><td> </td><td>unsigned long  </td><td><var class="pdparam">event_mask</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>dpy</code></em></span></dt><dd><p>
                    Specifies the connection to the X server.
                </p></dd><dt><span class="term"><em class="parameter"><code>draw</code></em></span></dt><dd><p>
                    Specifies a GLX drawable. Must be a GLX pixel buffer or a window.
                </p></dd><dt><span class="term"><em class="parameter"><code>event_mask</code></em></span></dt><dd><p>
                    Specifies the events to be returned for <em class="parameter"><code>draw</code></em>.
                </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
            <code class="function">glXSelectEvent</code> sets the GLX event mask for a GLX pixel buffer or a window.
            Calling <code class="function">glXSelectEvent</code> overrides any previous event mask that was
            set by the client for <em class="parameter"><code>draw</code></em>. Note that it does not affect the
            event masks that other clients may have specified for <em class="parameter"><code>draw</code></em> since
            each client rendering to <em class="parameter"><code>draw</code></em> has a separate event mask for it.
        </p><p>
            Currently, only one GLX event, <code class="constant">GLX_PBUFFER_CLOBBER_MASK</code>,
            can be selected. The following data is returned to the client when a
            <code class="constant">GLX_PBUFFER_CLOBBER_MASK</code> event occurs:
        </p><p>
            typedef struct {
        </p><div class="informaltable"><table><colgroup><col /><col /></colgroup><tbody><tr><td>
                            int <span class="emphasis"><em>event_type</em></span>;
                        </td><td>
                        /* GLX_DAMAGED or GLX_SAVED */
                        </td></tr><tr><td>
                            int <span class="emphasis"><em>draw_type</em></span>;
                        </td><td>
                        /* GLX_WINDOW or GLX_PBUFFER */
                        </td></tr><tr><td>
                            unsigned long <span class="emphasis"><em>serial</em></span>;
                        </td><td>
                        /* # of last request processed by server */
                        </td></tr><tr><td>
                            Bool <span class="emphasis"><em>send_event</em></span>;
                        </td><td>
                        /* true if this came for SendEvent request */
                        </td></tr><tr><td>
                            Display <span class="emphasis"><em>*display</em></span>;
                        </td><td>
                        /* display the event was read from */
                        </td></tr><tr><td>
                            GLXDrawable <span class="emphasis"><em>drawable</em></span>;
                        </td><td>
                        /* i.d. of Drawable */
                        </td></tr><tr><td>
                            unsigned int <span class="emphasis"><em>buffer_mask</em></span>;
                        </td><td>
                        /* mask indicating affected buffers */
                        </td></tr><tr><td>
                            int <span class="emphasis"><em>x, y</em></span>;
                        </td><td>

                        </td></tr><tr><td>
                            int <span class="emphasis"><em>width, height</em></span>;
                        </td><td>

                        </td></tr><tr><td>
                            int <span class="emphasis"><em>count</em></span>;
                        </td><td>
                        /* if nonzero, at least this many more */
                        </td></tr></tbody></table></div><p>
            } GLXPbufferClobberEvent;
            The valid bit masks used in <span class="emphasis"><em>buffer_mask</em></span> are:
        </p><p>
        </p><div class="informaltable"><table><colgroup><col /><col /></colgroup><thead><tr><th><span class="bold"><strong>
                        Bitmask
                        </strong></span></th><th><span class="bold"><strong>
                        Corresponding Buffer
                        </strong></span></th></tr></thead><tbody><tr><td>
                        <code class="constant">GLX_FRONT_LEFT_BUFFER_BIT</code>
                        </td><td>
                        Front left color buffer
                        </td></tr><tr><td>
                        <code class="constant">GLX_FRONT_RIGHT_BUFFER_BIT</code>
                        </td><td>
                        Front right color buffer
                        </td></tr><tr><td>
                        <code class="constant">GLX_BACK_LEFT_BUFFER_BIT</code>
                        </td><td>
                        Back left color buffer
                        </td></tr><tr><td>
                        <code class="constant">GLX_BACK_RIGHT_BUFFER_BIT</code>
                        </td><td>
                        Back right color buffer
                        </td></tr><tr><td>
                        <code class="constant">GLX_AUX_BUFFERS_BIT</code>
                        </td><td>
                        Auxiliary buffer
                        </td></tr><tr><td>
                        <code class="constant">GLX_DEPTH_BUFFER_BIT</code>
                        </td><td>
                        Depth buffer
                        </td></tr><tr><td>
                        <code class="constant">GLX_STENCIL_BUFFER_BIT</code>
                        </td><td>
                        Stencil buffer
                        </td></tr><tr><td>
                        <code class="constant">GLX_ACCUM_BUFFER_BIT</code>
                        </td><td>
                        Accumulation buffer
                        </td></tr></tbody></table></div><p>
            A single X server operation can cause several buffer clobber events to be
            sent. (e.g., a single GLX pixel buffer may be damaged and cause multiple
            buffer clobber events to be generated). Each event specifies one
            region of the GLX drawable that was affected by the X Server operation.
            The <span class="emphasis"><em>buffer_mask</em></span> field indicates which color buffers and
            ancillary buffers were affected. All the buffer clobber events
            generated by a single X server action are guaranteed to be
            contiguous in the event queue. The conditions under which this event is
            generated and the <span class="emphasis"><em>event_type</em></span> varies, depending on the type of the
            GLX drawable.
        </p><p>
            When the <code class="constant">GLX_AUX_BUFFERS_BIT</code> is set in <span class="emphasis"><em>buffer_mask</em></span>, then
            <span class="emphasis"><em>aux_buffer</em></span> is set to indicate which buffer was affected. If more
            than one aux buffer was affected, then additional events are
            generated as part of the same contiguous event group. Each
            additional event will have only the <code class="constant">GLX_AUX_BUFFERS_BIT</code> set in
            <span class="emphasis"><em>buffer_mask</em></span>, and the <span class="emphasis"><em>aux_buffer</em></span> field will be set
            appropriately. For nonstereo drawables,
            <code class="constant">GLX_FRONT_LEFT_BUFFER_BIT</code> and <code class="constant">GLX_BACK_LEFT_BUFFER_BIT</code> are
            used to specify the front and back color buffers.
        </p><p>
            For preserved GLX pixel buffers, a buffer clobber event with
            type <code class="constant">GLX_SAVED</code> is generated whenever the contents of the
            GLX pixel buffer is moved out of offscreen memory. The event(s) describes which
            portions of the GLX pixel buffer were affected. Clients who receive many
            buffer clobber events, referring to different save actions,
            should consider freeing the GLX pixel buffer resource in order to prevent
            the system from thrashing due to insufficient resources.
        </p><p>
            For an unpreserved GLXPbuffer, a buffer clobber event, with type
            <code class="constant">GLX_DAMAGED</code>, is generated whenever a portion of the GLX pixel buffer
            becomes invalid. The client may wish to regenerate the invalid portions
            of the GLX pixel buffer.
        </p><p>
            For Windows, buffer clobber events, with type <code class="constant">GLX_SAVED</code>, occur
            whenever an ancillary buffer, associated with the window, gets clobbered
            or moved out of off-screen memory. The event contains information
            indicating which color buffers and ancillary buffers\(emand which portions
            of those buffers\(emwere affected.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
            <code class="function">glXSelectEvent</code> is available only if the GLX version is 1.3 or greater.
        </p><p>
            If the GLX version is 1.1 or 1.0, the GL version must be 1.0.
            If the GLX version is 1.2, then the GL version must be 1.1.
            If the GLX version is 1.3, then the GL version must be 1.2.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
            <code class="constant">GLXBadDrawable</code> is generated if <em class="parameter"><code>draw</code></em> is not a valid window
            or a valid GLX pixel buffer.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
            <a class="citerefentry" href="glXGetSelectedEvent"><span class="citerefentry"><span class="refentrytitle">glXGetSelectedEvent</span></span></a>
        </p></div>
        {$pipelinestall}{$examples}
        <div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
            <a class="citerefentry" href="glXCreatePbuffer"><span class="citerefentry"><span class="refentrytitle">glXCreatePbuffer</span></span></a>
        </p></div><div class="refsect1" lang="en" xml:lang="en"><div id="Copyright"><h2>Copyright</h2><p>
            Copyright © 1991-2006
            Silicon Graphics, Inc. This document is licensed under the SGI
            Free Software B License. For details, see
            <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
        </p></div></div></div>
